package com.zhehekeji.opsys.api.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

// Generated 2015-8-6 15:03:31 by Hibernate Tools 3.4.0.CR1

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * TCmsProgram generated by hbm2java
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name="t_cms_program")
public class TCmsProgram implements java.io.Serializable {

	/** 
	* @Fields serialVersionUID : TODO
	*/ 
	private static final long serialVersionUID = 2456697486944231398L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID", length = 20, nullable = false, unique = true)
	private Long id;
	@Column(name = "ORIGINAL_CODE", length = 64, nullable = true)
	private String originalCode;
	@Column(name = "CODE", length = 64, nullable = true)
	private String code;
	@Column(name = "NAME", length = 128, nullable = true)
	private String name;
	@Column(name = "ORIGINAL_NAME", length = 128, nullable = true)
	private String originalName;
	@Column(name = "ORDER_NUMBER", length = 10, nullable = true)
	private String orderNumber;
	@Column(name = "SORT_NAME", length = 128, nullable = true)
	private String sortName;
	@Column(name = "SEARCH_NAME", length = 128, nullable = true)
	private String searchName;
	@Column(name = "GENRE", length = 128, nullable = true)
	private String genre;
	@Column(name = "DIRECTOR_DISPLAY", length = 256, nullable = true)
	private String directorDisplay;
	@Column(name = "ACTOR_DISPLAY", length = 256, nullable = true)
	private String actorDisplay;
	@Column(name = "WRITER_DISPLAY", length = 256, nullable = true)
	private String writerDisplay;
	@Column(name = "ORIGINAL_COUNTRY", length = 64, nullable = true)
	private String originalCountry;
	@Column(name = "LANGUAGE", length = 64, nullable = true)
	private String language;
	@Column(name = "RELEASE_YEAR", length = 4, nullable = true)
	private String releaseYear;
	@Column(name = "ORG_AIR_DATE", length = 8, nullable = true)
	private String orgAirDate;
	@Column(name = "LICENSING_WINDOW_START", length = 14, nullable = true)
	private String licensingWindowStart;
	@Column(name = "LICENSING_WINDOW_END", length = 14, nullable = true)
	private String licensingWindowEnd;
	@Column(name = "DISPLAY_AS_NEW", length = 3, nullable = true)
	private String displayAsNew;
	@Column(name = "DISPLAY_AS_LAST_CHANCE", length = 3, nullable = true)
	private String displayAsLastChance;
	@Column(name = "MACROVISION", length = 1, nullable = true)
	private Integer macrovision;
	@Column(name = "DESCRIPTION", length = 4000, nullable = true)
	private String description;
	@Column(name = "PRICE_TAX_IN", nullable = true)
	private Double priceTaxIn;
	@Column(name = "SOURCE_TYPE", length = 1, nullable = true)
	private Integer sourceType;
	@Column(name = "SERIES_FLAG", length = 1, nullable = true)
	private Integer seriesFlag;
	@Column(name = "TYPE", length = 128, nullable = true)
	private String type;
	@Column(name = "CONTENT_TYPE", length = 11, nullable = true)
	private Integer contentType;
	@Column(name = "KEYWORDS", length = 256, nullable = true)
	private String keywords;
	@Column(name = "RESERVE1", length = 1024, nullable = true)
	private String reserve1;
	@Column(name = "RESERVE2", length = 1024, nullable = true)
	private String reserve2;
	@Column(name = "RESERVE3", length = 1024, nullable = true)
	private String reserve3;
	@Column(name = "RESERVE4", length = 1024, nullable = true)
	private String reserve4;
	@Column(name = "RESERVE5", length = 1024, nullable = true)
	private String reserve5;
	@Column(name = "STORAGE_TYPE", length = 2, nullable = true)
	private String storageType;
	@Column(name = "RMEDIA_CODE", length = 128, nullable = true)
	private String rmediaCode;
	@Column(name = "DEFINITION_FLAG", length = 1, nullable = true)
	private Integer definitionFlag;
	@Column(name = "TAGS", length = 256, nullable = true)
	private String tags;
	@Column(name = "POSTER_URL", length = 1024, nullable = true)
	private String posterUrl;
	@Column(name = "THUMBNAIL_URL", length = 1024, nullable = true)
	private String thumbnailUrl;
	@Column(name = "RECOMMEND_URL", length = 1024, nullable = true)
	private String recommendUrl;
	@Column(name = "STILL_URL", length = 1024, nullable = true)
	private String stillUrl;
	@Column(name = "SERIES_CODE", length = 64, nullable = true)
	private String seriesCode;
	@Column(name = "SERIAL_NO", length = 11, nullable = true)
	private Integer serialNo;
	@Column(name = "STATUS", length = 2, nullable = true)
	private Integer status;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "ONLINE_TIME", nullable = true)
	private Date onlineTime;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "OFFLINE_TIME", nullable = true)
	private Date offlineTime;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATE_TIME", nullable = true)
	private Date updateTime;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", nullable = true)
	private Date createTime;
	@Column(name = "DURATION", length = 20, nullable = true)
	private String duration;
	@Column(name = "CP_CODE", length = 20, nullable = true)
	private Long cpCode;
	@Column(name = "CHANNEL_URL", length = 1024, nullable = true)
	private String channelUrl;
	@Column(name = "CONTENT_PROVIDER")
	private String contentProvider;
	@Column(name = "CMD_ID")
	private Long cmdID;
	
	@Column(name = "ISP", length = 1024, nullable = true)
    private String isp;
	
	 @Column(name = "DIANBO", length = 11, nullable = true)
	 private Integer dianbo;
	    
	 @Column(name = "DIANZAN", length = 11, nullable = true)
	 private Integer dianzan;

	/**
	 * 生成大洋XML时会使用
	 */
	@Transient
	private List<TCmsMovie> tcmsMovies;
	@Transient
	private TCmsSeries tcmsSeries;
	@Transient
	private String nanChuanPublishStatus;
	@Transient
	private String cisPublishStatus;

	/**
	 * 行业使用
	 */
	@Column(name = "HUA_WEI_CODE", length = 64, nullable = true)
	private String huaWeiCode;
	@Column(name = "HUA_WEI_PLAY_URL", length = 1024, nullable = true)
	private String huaWeiPlayUrl;
	@Column(name = "ZHONG_XING_PLAY_URL", length = 1024, nullable = true)
	private String zhongXingPlayUrl;
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		TCmsProgram other = (TCmsProgram) obj;
		if (code == null) {
			if (other.code != null) {
				return false;
			}
		} else if (!code.equals(other.code)) {
			return false;
		}
		return true;
	}

}
